how to build serverless rest api